//
//  GRiceMacro.h
//  YC_GRice
//
//  Created by LiuFeng on 2018/7/8.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#ifndef GRiceMacro_h
#define GRiceMacro_h

// 生产环境（production）
#define IsProduction

// 开发环境（development）
//#define IsDevelopment

///////////////////////////////////////////////////////////////////
/*
 *************************   API   *****************************
 */
#ifdef IsProduction

#define GRiceAPI           @"https://attach.xiaoguikuaipao.com/api/"
#define GRDeliveryAPI      @"https://logistics.xiaoguikuaipao.com/api/v1/"

#else
#ifdef IsDevelopment

#define GRiceAPI           @"https://dev-attach.xiaoguikuaipao.com/api/"
#define GRDeliveryAPI      @"https://dev-logistics.xiaoguikuaipao.com/api/v1/"


#endif
#endif


// =====================  其他常用宏  =========================

/*
 配置型宏
 */
#define HEXCOLOR(hex)                 [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16))/255.0 \
       green:((float)((hex & 0xFF00) >> 8))/255.0 \
       blue:((float)(hex & 0xFF))/255.0 \
       alpha:1.0]
#define HEXCOLORA(hex,ax)                 [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16))/255.0 \
green:((float)((hex & 0xFF00) >> 8))/255.0 \
blue:((float)(hex & 0xFF))/255.0 \
alpha:(float)ax]

// 常用颜色
#define KGMTHEM_COLOR               HEXCOLOR(0xFBD62D)
#define KGMGRAY_COLOR               HEXCOLOR(0x666666)
#define KGMBLACK_COLOR              HEXCOLOR(0x222222)
#define KGMBACKGROUND_COLOR    HEXCOLOR(0xEEEEEE)

#define IOSVERSON                   [[[UIDevice currentDevice] systemVersion] floatValue]
#define APPVERSON                   [NSString stringWithFormat:@"%@",[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]]

#define KscreenWidth                [UIScreen mainScreen].bounds.size.width
#define KscreenHeight               [UIScreen mainScreen].bounds.size.height
#define IS_IPHONEX                  ([UIApplication sharedApplication].statusBarFrame.size.height != 20 ? YES : NO)
#define IS_IPHONE5                  [UIScreen mainScreen].bounds.size.width ==320 && [UIScreen mainScreen].bounds.size.height == 568

#define WEAKSELF                    typeof(self) __weak weakSelf = self;


/*
 方法型宏
 */
#define NSStringNotNULL(string)     (string != nil && ![string isKindOfClass:[NSNull class]])
#define Dictionary(obj)                  (obj && [obj isKindOfClass:[NSDictionary class]])
#define Array(obj)                        (obj && [obj isKindOfClass:[NSArray class]])


// 第三方集成-秘钥
#define UMENGKEY                @"5b43093cf29d98749c0000ca"
#define JPUSHKEY                 @"e3d93177b7e298cc6b93af83"
#define WECHATKEY              @"wx2cdfffa2d7a5198a"
#define WECHATSECRET         @"57619bb310bbd5d78840b34a285684bd"
#define AMAPKEY                  @"2a3b4d72076276e647ecf501d149288e"
#define ALIPAYSCHEME          @"GRALIPAY"
#define BAIDUAPPID                @"13654662"
#define BAIDUKEY                 @"bfpxLjncmoi5Fb7WQM7rG9zu"
#define BDSECRETKEY           @"ZAI268htEA2z1jN8ekBSsoSNMBAn2bto"

// 七牛上传地址
#define QNUPLOADADDRESS         @"https://qnimg.xiaoguikuaipao.com/"

// app下载地址
#define APPDOWNLOADADDRESS      @"https://itunes.apple.com/us/app/龟米/id1387416035?l=zh&ls=1&mt=8"


/**
 购物车角标更新通知
 */
#define GRUpdateShoppingCartCornerNotification  @"UpdateShoppingCarCorner"
#define GRDidFinishLocationNotification               @"didFinishLocation"
#define GRDidLocationFailureNotification              @"didLocationFailure"


#endif /* GRiceMacro_h */

